<template>
  <div>
    <h1>测试my-slider组件</h1>
    <my-slider
      @click="hClick"
      @slideChange="change"
      style="width:200px;height:300px"
      :auto="2000"
      :curIdx="curIdx"
      :list="list"
    ></my-slider>
  </div>
</template>

<script type="text/javascript">
export default {
  name: 'PageSlider',
  data () {
    return {
      curIdx: 5,
      list: [
        { url: require('./img/1.jpg'), alt: '肖申克的救赎' },
        { url: require('./img/2.jpg'), alt: '阿甘正传' },
        { url: require('./img/3.jpg'), alt: '幸福来敲门' },
        { url: require('./img/4.jpg'), alt: '这个杀手不太冷' },
        { url: require('./img/5.jpg'), alt: '机器人大战' },
        { url: require('./img/6.jpg'), alt: '忠犬八公' }
      ]
    }
  },
  methods: {
    hClick (index) {
      //   console.log('子组件slide中，第' + index + '被点击了')
    },
    change (idx) {
      //   console.log(idx)
    }
  }
}
</script>

<style scoped lang="less" >
</style>
